<?php
namespace App\Repositories;
use App\Models\Classnum;
use App\Models\Coach;
use App\Models\Nation;
use App\Models\Teacharea;
use App\Models\Trainingcar;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/6/15
 * Time: 9:54
 */



class SelectRepository
{

    /**
     * 学车类型
     * @return array
     */
    public function trainType()
    {
        //return ['C1','A1','A2','A3','B1','B2','C2','C3','C4','C5','D','E','F','M','N','P'];
        return ['A1','A2','A3','B1','B2','C1','C2','C3','C4','C5','D','E','F','M','N','P'];
    }

    public function needtrainType(){
        return ['A1','A2','A3','B1','B2','C1','C2','C3','C4','C5'];
    }


    public function getSubscribeType()
    {
        return ['1'=>'一车一人','2'=>'一车多人','9'=>'其他'];
    }

    /**
     *  付费模式
     * @return array
     */
    public function paymode()
    {
        return ['1'=>'先学后付','2'=>'先付后学','9'=>'其他'];
    }

    /**
     *  培训模式
     * @return array
     */
    public function trainningmode()
    {
        return ['1'=>'定时培训','2'=>'预约培训','9'=>'其他'];
    }

    /**
     *  收费模式
     * @return array
     */
    public function chargemode()
    {
        return ['1'=>'一次性收费','2'=>'计时收费','9'=>'其他'];
    }

    /**
     *  终端类型
     * @return array
     */
    public function getDeviceType()
    {
        return ['1'=>'车载计程计时终端','2'=>'课堂教学计时终端','3'=>'模拟训练计时终端'];
    }

    /**
     *  民族
     * @return mixed
     */
    public function nations()
    {
        return Nation::orderBy('id','asc')->lists('nation','nationid');
    }

    /**
     *  入学期数
     * @return mixed
     */
    public function classnum()
    {
        return Classnum::where('school_id','=',\Auth::user()->item_id)->orderBy('id','desc')->lists('name','id')->toArray();
    }

    /**
     *  车牌颜色
     * @return array
     */
    public function color()
    {
       return ['1'=>'蓝色','2'=>'黄色','3'=>'黑色','4'=>'白色','5'=>'绿色','6'=>'红色','9'=>'其他'];
    }

    /**
     *  车辆等级
     * @return array
     */
    public function grades()
    {
        return ['1'=>'一级','2'=>'二级','3'=>'三级','9'=>'其他'];
    }

    /**
     *  车辆燃油类型
     * @return array
     */
    public function fuels()
    {
        return ['1'=>'汽油','2'=>'柴油','3'=>'天然气','4'=>'电能','5'=>'液化石油气','9'=>'其他'];
    }

    /**
     *  获取车牌号
     */
    public function getlicnum()
    {
        return Trainingcar::where('school_id',\Auth::user()->item_id)->select('id','licnum')->get()->toArray();
    }

    /**
     *  获取教练
     * @return mixed
     */
    public function getCoachs()
    {
       return Coach::where('school_id',\Auth::user()->item_id)->lists('name','id')->toArray();
    }
    
    /**
     * 学历
     * @return array
     */
    public function education(){
        return ['1'=>'本科','2'=>'专科','3'=>'其他'];
    }


    public function otherdevice($ty = 1){

        $arr[1] = [
            ['id'=>'1','name'=>'计算机'],
            ['id'=>'2','name'=>'多媒体教学软件及设备'],
            ['id'=>'3','name'=>'教学磁板'],
            ['id'=>'4','name'=>'机动车驾驶模拟器'],
            ['id'=>'5','name'=>'车辆安全带保护作用体验装置']
        ];
        $arr[2] = [
            ['id'=>'6','name'=>'计时培训系统企业应用平台'],
            ['id'=>'7','name'=>'计时培训系统理论计时终端'],
            ['id'=>'8','name'=>'计时培训系统模拟计时终端'],
            ['id'=>'9','name'=>'计时培训系统车载计时计程终端']
        ];
        $arr[3] = [
            ['id'=>'10','name'=>'交通信号挂图'],
            ['id'=>'11','name'=>'机动车结构及工作原理挂图']

        ];
        $arr[4] = [
            ['id'=>'12','name'=>'透明或实体整车解剖模型'],
            ['id'=>'13','name'=>'发动机透明或解剖模型']
        ];
        $arr[5] = [
            ['id'=>'14','name'=>'心肺复苏训练模拟人'],
            ['id'=>'15','name'=>'急救用品(包括止血带，三角巾，固定夹板，包扎纱布及汽车急救包等)']
        ];
        $arr[6] = [
            ['id'=>'16','name'=>'其他']
        ];

        return $arr[$ty];
    }

    public function devicetype(){
        $arr = [
            ['id'=>'1','name'=>'电气化教学设备'],
            ['id'=>'2','name'=>'教学管理信息系统'],
            ['id'=>'3','name'=>'教学挂图'],
            ['id'=>'4','name'=>'模型教具'],
            ['id'=>'5','name'=>'医学教护用具'],
            ['id'=>'6','name'=>'其他']
        ];
        return $arr;
    }

    public function devtype(){
        return ['1'=>'电气化教学设备','2'=>'教学管理信息系统','3'=>'教学挂图','4'=>'模型教具','5'=>'医学教护用具','6'=>'其他'];
    }
    public function devicename(){
        return ['1'=>'计算机','2'=>'多媒体教学软件及设备','3'=>'教学磁板','4'=>'机动车驾驶模拟器','5'=>'车辆安全带保护作用体验装置',
            '6'=>'计时培训系统企业应用平台','7'=>'计时培训系统理论计时终端','8'=>'计时培训系统模拟计时终端','9'=>'计时培训系统车载计时计程终端',
            '10'=>'交通信号挂图','11'=>'机动车结构及工作原理挂图',
            '12'=>'透明或实体整车解剖模型','13'=>'发动机透明或解剖模型',
            '14'=>'心肺复苏训练模拟人','15'=>'急救用品(包括止血带，三角巾，固定夹板，包扎纱布及汽车急救包等)','16'=>'其他'
        ];
    }

    /**下拉菜单
     * @param $id
     * @return mixed
     */
    public function teachareas()
    {
        return Teacharea::where('school_id',\Auth::user()->item_id)->lists('name','id')->toArray();
    }
}